package com.starbucket.vo;


import com.starbucket.user.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor

public class UserResult<T> {
    private Integer code;
    private String message;
    private T data;


    public static UserResult<Object> success(User user) {
        return new UserResult<>(200, "success", user);
    }


    public static UserResult<Object> notExist(String data) {
        return new UserResult<>(404, "error", data);
    }

    public static UserResult<Object> fail(String data) {
        return new UserResult<>(500, "error", data);
    }

}
